<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>v-on与缩写形式@的应用</title>
<!--引入Vue库-->
<script src="vue.js"></script>
</head>
<body>	
<div id="main">	
    <!-- 为button按钮绑定click事件 -->
    <button v-on:click="showInfo">登录</button>	  
    <p>{{ message }}</p>
    <button @click="add">增加</button>
    <div>购买数量：{{ count }}</div>
</div>
<script>
  var vm=new Vue({ 
      el: "#main",
      data: {
          message: "",
          count:1
          },
      methods: {
          // 定义事件处理方法showInfo
          showInfo () {
              this.message = "欢迎登录"
             },
          add(){
              this.count++;
         }
      }
   })
</script>
</body>
</html>
